package leetcode_1_200;

import java.time.chrono.IsoChronology;

public class LeeCode_125 {
    public static void main(String[] args) {
        //System.out.println(isPalindrome("A man, a plan, a canal: Panama"));
        System.out.println(isPalindrome("0P"
        ));
    }
    private static boolean isPalindrome(String s) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c >= 'A' && c <= 'Z'){
                sb.append((char) (c + ('a' - 'A')));
            }else if ((c >= 'a' && c <= 'z') || (c >= '0' && c <='9')){
                sb.append(c);
            }
        }
        String s1 = sb.toString();
        String s2 = sb.reverse().toString();
        return s1.equals(s2);
    }
}
